using System;
using System.Collections.Generic;
using System.Linq;

using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.Dialog;

namespace Socialite
{
	[MonoTouch.Foundation.Register("SignupScreen")]
	public partial class SignupScreen : BaseTablessScreen
	{
		private UIBarButtonItem _joinButton;
			
		public SignupScreen () : base (UITableViewStyle.Grouped, null, true)
		{
			BasicSignupInfo signupInfo = new BasicSignupInfo ();
			var bctx = new BindingContext (null, signupInfo, "Join Socialite");
			Root = bctx.Root;
		}
		
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			if (_joinButton == null)
				_joinButton = new UIBarButtonItem (
					"Join",
					UIBarButtonItemStyle.Done,
					(sender, args) => {NavigationController.PopViewControllerAnimated (true);});
			
			NavigationController.TopViewController.NavigationItem.SetRightBarButtonItem (_joinButton, true);
		} 
	}
}
